package com.ubao.bean;

import java.io.Serializable;

import com.ubao.network.Url;
import com.ubao.util.log.Logger;

public class Commodity implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	public static String COMMODITY = "commodity";
//	字段名称	字段类型	字段长度	字段说明
	private String Id;//	Int		自动生成
	private String CommodityID;//	uniqueidentifier		商品id
	private String CommodityName;//	nvarchar(50)		商品名称
	private String CommodityDescription;//	varchar(2000)		商品描述
	private String ReleaseDate;//	datetime		上架时间
	private String CommodityType;//	int		类别的ID
	private String CommodityTypeName;//	nvarchar(50)		类别的名称
	private String IsExchange;//	int		是否交换过 1是 0否
	private String IsShare;//	int		是否分享过1是 0否
	private String CreateTime;//	datetime		创建时间
	private String Score;//	float		商品的分数
	private String Longitude;//	float		经度
	private String Latitude;//	float		纬度
	private String CommentNo;//	int		评论数
	private String UserID;//	nvarchar(50)		用户ID
	//private String CommodityID;//	uniqueidentifier		商品的ID
	private String Country;//	varchar(20)		国家
	private String City;//	varchar(20)		城市
	private String Locality;//	varchar(20)		国外的表示方法
	private String SubLocality;//	varchar(20)		区域
	private String StarNo;//	int		星级个数
	private String StarNoOfOne;//	int		一星的个数
	private String imagePath;//	varchar(100)		图片路径
	private String imagePath_small;
	private String imagePath_middle;
	private String ViewNo;//	int		查看次数
	private String ShelfTime;//	datetime		商家时间
	private String FollowingNo;
	public String getId() {
		return Id;
	}
	public void setId(String id) {
		Id = id;
	}
	public String getCommodityID() {
		return CommodityID;
	}
	public void setCommodityID(String commodityID) {
		CommodityID = commodityID;
	}
	public String getCommodityName() {
		return CommodityName;
	}
	public void setCommodityName(String commodityName) {
		CommodityName = commodityName;
	}
	public String getCommodityDescription() {
		return CommodityDescription;
	}
	public void setCommodityDescription(String commodityDescription) {
		CommodityDescription = commodityDescription;
	}
	public String getReleaseDate() {
		return ReleaseDate;
	}
	public void setReleaseDate(String releaseDate) {
		ReleaseDate = releaseDate;
	}
	public String getCommodityType() {
		return CommodityType;
	}
	public void setCommodityType(String commodityType) {
		CommodityType = commodityType;
	}
	public String getCommodityTypeName() {
		return CommodityTypeName;
	}
	public void setCommodityTypeName(String commodityTypeName) {
		CommodityTypeName = commodityTypeName;
	}
	public String getIsExchange() {
		return IsExchange;
	}
	public void setIsExchange(String isExchange) {
		IsExchange = isExchange;
	}
	public String getIsShare() {
		return IsShare;
	}
	public void setIsShare(String isShare) {
		IsShare = isShare;
	}
	public String getCreateTime() {
		return CreateTime;
	}
	public void setCreateTime(String createTime) {
		CreateTime = createTime;
	}
	public String getScore() {
		return Score;
	}
	public void setScore(String score) {
		Score = score;
	}
	public String getLongitude() {
		return Longitude;
	}
	public void setLongitude(String longitude) {
		Longitude = longitude;
	}
	public String getLatitude() {
		return Latitude;
	}
	public void setLatitude(String latitude) {
		Latitude = latitude;
	}
	public String getCommentNo() {
		return CommentNo;
	}
	public void setCommentNo(String commentNo) {
		CommentNo = commentNo;
	}
	public String getUserID() {
		return UserID;
	}
	public void setUserID(String userID) {
		UserID = userID;
	}
	public String getCountry() {
		return Country;
	}
	public void setCountry(String country) {
		Country = country;
	}
	public String getCity() {
		return City;
	}
	public void setCity(String city) {
		City = city;
	}
	public String getLocality() {
		return Locality;
	}
	public void setLocality(String locality) {
		Locality = locality;
	}
	public String getSubLocality() {
		return SubLocality;
	}
	public void setSubLocality(String subLocality) {
		SubLocality = subLocality;
	}
	public String getStarNo() {
		return StarNo;
	}
	public void setStarNo(String starNo) {
		StarNo = starNo;
	}
	public String getStarNoOfOne() {
		return StarNoOfOne;
	}
	public void setStarNoOfOne(String starNoOfOne) {
		StarNoOfOne = starNoOfOne;
	}
	public String getImagePath() {
		return addHttp(imagePath);
	}
	private String addHttp(String url){
		if(!url.startsWith("http://" + Url.url)){
			url = "http://" + Url.url + "/" + url;
		}
		return url;
	}
	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
		this.imagePath_small = imagePath.substring(0,imagePath.indexOf("."))+
						"_1" + imagePath.substring(imagePath.indexOf("."),imagePath.length());
		this.imagePath_middle = imagePath.substring(0,imagePath.indexOf("."))+
						"_2" + imagePath.substring(imagePath.indexOf("."),imagePath.length());
	}
	public String getImagePath_small() {
		return addHttp(imagePath_small);
	}
	public void setImagePath_small(String imagePath_small) {
		this.imagePath_small = imagePath_small;
	}
	public String getImagePath_middle() {
		return addHttp(imagePath_middle);
	}
	public void setImagePath_middle(String imagePath_middle) {
		this.imagePath_middle = imagePath_middle;
	}
	public String getViewNo() {
		return ViewNo;
	}
	public void setViewNo(String viewNo) {
		ViewNo = viewNo;
	}
	public String getShelfTime() {
		return ShelfTime;
	}
	public void setShelfTime(String shelfTime) {
		ShelfTime = shelfTime;
	}
	public String getFollowingNo() {
		return FollowingNo;
	}
	public void setFollowingNo(String followingNo) {
		FollowingNo = followingNo;
	}
	@Override
	public String toString() {
		return "Commodity [Id=" + Id + ", CommodityID=" + CommodityID
				+ ", CommodityName=" + CommodityName
				+ ", CommodityDescription=" + CommodityDescription
				+ ", ReleaseDate=" + ReleaseDate + ", CommodityType="
				+ CommodityType + ", CommodityTypeName=" + CommodityTypeName
				+ ", IsExchange=" + IsExchange + ", IsShare=" + IsShare
				+ ", CreateTime=" + CreateTime + ", Score=" + Score
				+ ", Longitude=" + Longitude + ", Latitude=" + Latitude
				+ ", CommentNo=" + CommentNo + ", UserID=" + UserID
				+ ", Country=" + Country + ", City=" + City + ", Locality="
				+ Locality + ", SubLocality=" + SubLocality + ", StarNo="
				+ StarNo + ", StarNoOfOne=" + StarNoOfOne + ", imagePath="
				+ imagePath + ", ViewNo=" + ViewNo + ", ShelfTime=" + ShelfTime
				+ ", FollowingNo=" + FollowingNo + "]";
	}

}
